import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/home/home.vue'),
      redirect: '/index',
      children: [
        {
          path: 'index',
          name: 'index',
          component: () => import('../views/index/index.vue'),
          children:[
            {
              path:"schedule",
              name: 'schedule',
              component: () => import('../views/index/schedule.vue')
            },{
              path:"workbench",
              name: 'workbench',
              component: () => import('../views/index/workbench.vue')
            }
          ]
        }, 
        {
          path: 'AppCenter',
          name: 'AppCenter',
          component: () => import('../views/AppCenter/AppCenter.vue'),
          children: [
            {
              path: '/AppCenter/Attendance',
              name: 'Attendance',
              component: () => import('../views/AppCenter/Attendance/index.vue')
            },
            {
              path: '/AppCenter/cart',
              name: 'cart',
              component: () => import('../views/AppCenter/cart/index.vue')
            },
            {
              path: '/AppCenter/documentlibrary',
              name: 'documentlibrary',
              component: () => import('../views/AppCenter/documentlibrary/index.vue')
            },
            {
              path: '/AppCenter/employee',
              name: 'employee',
              component: () => import('../views/AppCenter/employee/index.vue')
            },
            {
              path: '/AppCenter/News',
              name: 'News',
              component: () => import('../views/AppCenter/News/index.vue')
            },
            {
              path: '/AppCenter/salary',
              name: 'salary',
              component: () => import('../views/AppCenter/salary/index.vue')
            },
            {
              path: '/AppCenter/settings',
              name: 'settings',
              component: () => import('../views/AppCenter/settings/index.vue')
            }
          ]
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/login.vue')
    }
  ]
})

export default router
